package com.example.demo.controller;

import com.example.demo.service.TbTagService;
import com.example.demo.utils.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api("标签API")
@RestController
@RequestMapping("/api/tag")
public class TagController {
    TbTagService tbTagService;

    @Autowired
    void setTbTagService(TbTagService tbTagService) {
        this.tbTagService = tbTagService;
    }

    @ApiOperation("获取全部标签")
    @GetMapping("getAllTag")
    public Result getAllTag() {
        return new Result(0, "success", tbTagService.getAllTag());
    }
}
